package com.jun.rabbitmq.consumer.listener;

import com.jun.common.rabbitmq.constant.QueueConstant;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;

import java.util.Map;

/**
 * @author yuejun.li
 * @date 2024/4/18 14:29:55
 */
//@Component
public class TopicListener {

    @RabbitListener(queues = QueueConstant.MAN)
    @RabbitHandler
    public void process(Map testMessage) {
        System.out.println("第一次消费者收到消息: " + testMessage.toString());
    }

    @RabbitListener(queues = QueueConstant.WOMAN)
    @RabbitHandler
    public void secondProcess(Map testMessage) {
        System.out.println("第二次消费者收到消息  : " + testMessage.toString());
    }
}
